home *** CD-ROM | disk | FTP | other *** search
/ Material Dictionary 112:…okohama - Business Cities / Material Dictionary 112: Tokyo & Yokohama - Business Cities.iso / mac / SOZAI112 / SOZAI.EXE / SOZAI.dxr / 00121.ls < prev    next >
Encoding:
Text File  |  1999-12-15  |  5.7 KB  |  248 lines

  1. on startMovie
  2.   if the castType of cast 941 = #empty then
  3.     set msg to "├»K├│v├ç┬╗├ët├ë@├ëC├ë├ú├çΓäó├Ñ┬⌐├ç┬¼├ç┬⌐├ç├ï├çΓÇ╣├ç├╛├ç├Æ├àBCD-ROM├ç┬⌐├ç├ü├⌐┬┐├ºs├ç┬╡├ç╞Æ├ç┬ì├ç├ª├ç┼╜├ç┬ó├àB"
  4.     set msg to msg & RETURN
  5.     set msg to msg & "Cannot find required file. Run the program on CD-ROM."
  6.     alert(msg)
  7.     go("End")
  8.   end if
  9. end
  10.  
  11. on setup
  12.   global pictsp, scrollthumbsp, scrollTop, scrollmax, firstv
  13.   set pictsp to 1
  14.   set scrollthumbsp to 12
  15.   set scrollTop to 0
  16.   set h to the height of cast the castNum of sprite pictsp
  17.   set scrollmax to integer((h / float(75 + 26)) + 0.5) - 4
  18.   set firstv to the locV of sprite pictsp
  19. end
  20.  
  21. on keyhandler
  22.   if not (the controlDown) then
  23.     dontPassEvent()
  24.   end if
  25.   if the controlDown and ((the key = "c") or (the key = "C")) then
  26.     set the text of cast "Selection" to the selection
  27.     copyToClipBoard(cast "Selection")
  28.     dontPassEvent()
  29.   end if
  30. end
  31.  
  32. on stopMovie
  33.   set the text of cast "FilePath" to " "
  34.   set the text of cast "Selection" to " "
  35. end
  36.  
  37. on m2w path
  38.   repeat with i = 1 to the maxinteger
  39.     set c to char i of path
  40.     if c = EMPTY then
  41.       exit repeat
  42.     end if
  43.     if c = ":" then
  44.       put "\" into char i of path
  45.     end if
  46.   end repeat
  47.   return path
  48. end
  49.  
  50. on w2m path
  51.   repeat with i = 1 to the maxinteger
  52.     set c to char i of path
  53.     if c = EMPTY then
  54.       exit repeat
  55.     end if
  56.     if c = "\" then
  57.       put ":" into char i of path
  58.     end if
  59.   end repeat
  60.   return path
  61. end
  62.  
  63. on scrolldown
  64.   global scrollTop, scrollmax
  65.   if (scrollTop - 1) < 0 then
  66.     exit
  67.   end if
  68.   set scrollTop to scrollTop - 1
  69.   updatethumb()
  70.   adjustselect(-1)
  71.   updatepict()
  72. end
  73.  
  74. on pagedown
  75.   global scrollTop, scrollmax
  76.   if scrollTop = 0 then
  77.     exit
  78.   end if
  79.   set tscrolltop to scrollTop - 4
  80.   if tscrolltop < 0 then
  81.     set tscrolltop to 0
  82.   end if
  83.   adjustselect(tscrolltop - scrollTop)
  84.   set scrollTop to tscrolltop
  85.   updatethumb()
  86.   indicate()
  87.   updatepict()
  88. end
  89.  
  90. on scrollup
  91.   global scrollTop, scrollmax
  92.   if (scrollTop + 1) > scrollmax then
  93.     exit
  94.   end if
  95.   set scrollTop to scrollTop + 1
  96.   updatethumb()
  97.   adjustselect(1)
  98.   updatepict()
  99. end
  100.  
  101. on pageup
  102.   global scrollTop, scrollmax
  103.   if scrollTop = scrollmax then
  104.     exit
  105.   end if
  106.   set tscrolltop to scrollTop + 4
  107.   if tscrolltop > scrollmax then
  108.     set tscrolltop to scrollmax
  109.   end if
  110.   adjustselect(tscrolltop - scrollTop)
  111.   set scrollTop to tscrolltop
  112.   updatethumb()
  113.   indicate()
  114.   updatepict()
  115. end
  116.  
  117. on adjustselect delta
  118.   set nv to the locV of sprite 19 - (delta * 101)
  119.   if (nv < 20) or (nv > 400) then
  120.     deselect()
  121.   else
  122.     set the locV of sprite 19 to nv
  123.   end if
  124. end
  125.  
  126. on updatethumb
  127.   global pictsp, scrollthumbsp, scrollTop, scrollmax
  128.   set basesp to scrollthumbsp - 1
  129.   set len to the height of sprite basesp - the height of sprite scrollthumbsp
  130.   set pos to scrollTop * len / scrollmax
  131.   set the locV of sprite scrollthumbsp to the locV of sprite basesp + pos
  132.   updateStage()
  133. end
  134.  
  135. on thumbpressed ov
  136.   global pictsp, scrollthumbsp, scrollTop, scrollmax
  137.   set cn to the castNum of sprite scrollthumbsp
  138.   set the castNum of sprite scrollthumbsp to cn + 1
  139.   set basesp to scrollthumbsp - 1
  140.   set h to the height of sprite scrollthumbsp
  141.   set lastv to the locV of sprite scrollthumbsp
  142.   set dv to the mouseV - ov
  143.   updateStage()
  144.   repeat while the stillDown
  145.     set nv to the mouseV - dv
  146.     if nv < the top of sprite basesp then
  147.       set nv to the top of sprite basesp
  148.     end if
  149.     if nv > (the bottom of sprite basesp - h) then
  150.       set nv to the bottom of sprite basesp - h
  151.     end if
  152.     if the mouseV < (the top of sprite basesp - 100) then
  153.       set nv to lastv
  154.     end if
  155.     if the mouseV > (the bottom of sprite basesp + 100) then
  156.       set nv to lastv
  157.     end if
  158.     if the mouseH < (the left of sprite basesp - 30) then
  159.       set nv to lastv
  160.     end if
  161.     if the mouseH > (the right of sprite basesp + 30) then
  162.       set nv to lastv
  163.     end if
  164.     set the locV of sprite scrollthumbsp to nv
  165.     updateStage()
  166.     indicate()
  167.   end repeat
  168.   deselect()
  169.   set scrollTop to thumbindex()
  170.   updatethumb()
  171.   indicateoff()
  172.   updatepict()
  173.   set the castNum of sprite scrollthumbsp to cn
  174.   updateStage()
  175. end
  176.  
  177. on deselect
  178.   set the text of cast "FilePath" to " "
  179.   set the selStart to 0
  180.   set the selEnd to 0
  181.   out(19)
  182.   updateStage()
  183. end
  184.  
  185. on indicate
  186.   set topone to (thumbindex() * 5) + 1
  187.   set the text of cast "Indicator" to topone & "-" & topone + 20 - 1
  188. end
  189.  
  190. on indicateoff
  191.   set the text of cast "Indicator" to " "
  192. end
  193.  
  194. on thumbindex
  195.   global pictsp, scrollthumbsp, scrollTop, scrollmax
  196.   set basesp to scrollthumbsp - 1
  197.   set len to the height of sprite basesp - the height of sprite scrollthumbsp
  198.   set pos to the locV of sprite scrollthumbsp - the locV of sprite basesp
  199.   return ((pos * scrollmax) + (len / 2)) / len
  200. end
  201.  
  202. on updatepict
  203.   global pictsp, firstv, scrollTop
  204.   startTimer()
  205.   set the locV of sprite pictsp to firstv - (scrollTop * 101)
  206.   updateStage()
  207.   if the optionDown then
  208.     exit
  209.   end if
  210.   repeat while the timer < 10
  211.     nothing()
  212.   end repeat
  213.   if the controlDown then
  214.     repeat while the timer < 15
  215.       nothing()
  216.     end repeat
  217.   end if
  218. end
  219.  
  220. on in sp
  221.   if the locH of sprite sp < 0 then
  222.     set the locH of sprite sp to the locH of sprite sp + 3000
  223.   end if
  224. end
  225.  
  226. on out sp
  227.   if the locH of sprite sp > 0 then
  228.     set the locH of sprite sp to the locH of sprite sp - 3000
  229.   end if
  230. end
  231.  
  232. on buttondown
  233.   set cn to the castNum of sprite the clickOn
  234.   set the castNum of sprite the clickOn to cn + 1
  235.   updateStage()
  236.   repeat while the stillDown
  237.     if rollOver(the clickOn) then
  238.       set the castNum of sprite the clickOn to cn + 1
  239.     else
  240.       set the castNum of sprite the clickOn to cn
  241.     end if
  242.     updateStage()
  243.   end repeat
  244.   set the castNum of sprite the clickOn to cn
  245.   updateStage()
  246.   return rollOver(the clickOn)
  247. end
  248.